1. Field of the Invention
The present invention relates to a coding device for encoding a difference between a sampling value and its predicted value.
2. Related Background Art
Upon transmission of digital image or voice information, encoding is performed to reduce a transmission information volume.
As one encoding method, differential pulse code modulation (to be referred to as DPCM hereinafter) is known. In this method, an information volume is compressed by utilizing a correlation between adjacent sampling values. More specifically, an encoded sampling value is temporarily decoded, a predicted value of the next sampling value is obtained using the decoded value, and a difference between this predicted value and an input sampling value is quantized to perform encoding.
FIG. 1 is a block diagram showing an arrangement of a coding device according to the above-mentioned principle. FIG. 2 shows a sampling pattern of a subsampler shown in FIG. 1.
The device shown in FIG. 1 includes an input terminal 1 for receiving input data X.sub.i (e.g., a digital television signal) obtained by sampling a video signal, a prefilter 2 for attenuating a two-dimensional spatial frequency region in the input data X.sub.i, a subsampler 3 for performing field-offset subsampling of the output signal from the prefilter 2, a DPCM encoder 4 for performing DPCM of the output signal from the subsampler 3, a transmission path 5, a DPCM decoder 6 for decoding an encoded signal from the DPCM encoder 4, and performing band expansion processing, an interpolation filter 7 for interpolating a signal subjected to expansion processing by the DPCM decoder, and an output terminal 8 for outputting output data V.sub.i.
In the above arrangement, the input terminal 1 receives an 8-bit digital television signal. A predetermined two-dimensional spatial frequency region of the digital television signal is attenuated by the prefilter 2. The digital television signal is then subjected to offset subsampling by the subsampler 3. The offset subsampling is executed in accordance with a pattern shown in FIG. 2.
In FIG. 2, solid lines represent scanning lines of a first field, and broken lines represent scanning lines of a second field. Note that an input signal is assumed to be a 2-to-1 interlaced television signal. The television signal is sampled at points indicated by marks "o" and "x" in a matrix, and the subsampler 3 transmits only sampling points (pixels) of the marks "o" (fs is a sampling frequency). In this manner, known field-offset subsampling for extracting pixels in a checkerboard manner is executed, and a receiver side interpolates non-transmitted sampling points using the interpolation filter 7, thereby allowing transmission of a digital signal without decreasing horizontal and vertical resolutions. Although an oblique resolution is degraded, visual characteristics of a person have a lower oblique resolution than the horizontal and vertical resolutions. Thus, such degradation is negligible. Note that the characteristics of the prefilter 2 are designed to attenuate an oblique direction of a spatial frequency, thereby preventing aliasing distortion caused by the above-mentioned subsampling.
A signal subsampled by the subsampler 3, e.g., an 8-bit signal per sampling point (pixel), is compressed to a 4-bit signal by the DPCM encoder 4, and is sent onto the transmission path 5. The 4-bit encoded signal is decoded by the DPCM decoder 6, and is expanded to the original 8-bit signal. Thereafter, the interpolation filter 7 interpolates the sampling points which are not transmitted onto the transmission path 5 and indicated by the marks "x" in FIG. 2 on the basis of the surrounding transmitted sampling points. Interpolated output data V.sub.i are output from the output terminal 8.
The arrangement of the DPCM encoder 4 shown in FIG. 1 will be described below. FIG. 3 is a block diagram showing a conventional arrangement of the DPCM encoder 4. As described above, encoding employs a method of temporarily decoding (locally decoding) an encoded sampling value, obtaining a predicted value of the next sampling value using the decoded value, and quantizing a difference between the predicted value and an actual value to perform encoding.
The encoder 4 includes an input terminal 10 for receiving a sampling value X.sub.i, a subtracter 12 for subtracting a predicted value P.sub.i (a decoded value of a previous sampling value) from the sampling value X.sub.i, a quantizer 14 for quantizing a difference output from the subtracter 12 and outputting the quantized output as a DPCM code Y.sub.i to an output terminal 16, an inverse quantizer 18 for decoding the DPCM code Y.sub.i to a difference, an adder 20 for adding the predicted value P.sub.i and the output signal from the inverse quantizer 18 to restore the difference to the sampling value, a limiter 22 for limiting the amplitude of the output signal from the adder 20 to a predetermined range to obtain a local decoded value V.sub.i, and a D flip-flop 24 for applying the local decoded value V.sub.i output from the limiter 22 to the subtracter 12 as a predicted value P.sub.i+1 of the next sampling value X.sub.i+1.
The operation of the DPCM encoder 4 shown in FIG. 3 will be described below.
The subtracter 12 subtracts the predicted value P.sub.i from the sampling value X.sub.i input to the input terminal 10. A difference obtained by this subtraction is quantized by the quantizer 14, and the quantized value is output to the output terminal 16 as the DPCM code Y.sub.i. The output from the quantizer 14 is applied to the inverse quantizer 18, so that the DPCM code Y.sub.i is decoded to the difference. The difference is then output to the adder 20. The adder 20 adds the predicted value P.sub.i output from the D flip-flop 24 to the difference. The difference (quantization typical value) is restored to the sampling value (local decoded value). The amplitude of the restored sampling value is limited to a predetermined range by the limiter 22. Thereafter, the sampling value is applied to the D flip-flop 24. The D flip-flop 24 outputs the local decoded value output from the limiter 22 in synchronism with a clock signal, and applies it to the subtracter 12 as the predicted value P.sub.i+1 of the next sampling value X.sub.i+1.
In general, a distribution of differences of predicted values is deviated to smaller values. Therefore, when the differences are encoded by nonlinear quantization and the encoded values are transmitted, transmission of compressed information is allowed.
In the conventional coding device described above, a previous value, i.e., a value before an immediately preceding value is used as a predicted value. Therefore, when subsampling is performed, a spatial distance between sampling points is prolonged, and prediction precision is decreased. For this reason, a distortion caused by quantization appears on an image, and this causes degradations such as edge business (image quality degradation at an edge portion), granular noise (noise in a reproduced image in a flat portion), and the like. Thus, high-quality image transmission is difficult to achieve.
In order to solve this problem, so-called two-dimensional prediction for generating a predicted value by utilizing not only sampling values on the same horizontal scanning line but also sampling values on other scanning lines is executed to improve prediction precision.
However, a device for transmitting a differentially encoded code must consider so-called "propagation of errors". Generation of "propagation of errors" is caused by the fact that when an error occurs in a differential code in transmission, not only a value decoded using this differential code but also all the following values decoded using this decoded value become unreliable.
Therefore, in the coding device for performing the above-mentioned two-dimensional prediction, if an error occurs in one decoded value, the error propagates to a plurality of other decoded values. In particular, when a magnetic recording system is assumed to be used as a transmission path, errors often occur in successively transmitted (recorded/reproduced) codes, i.e., so-called burst errors often occur. Since codes are normally transmitted in the raster order, the error in the codes appears as an error in horizontally successive codes. A serious situation may occur wherein most of a screen cannot be reproduced due to propagation of a code error in the vertical direction of the screen.
It is difficult for the coding device for performing the above-mentioned two-dimensional prediction to perform parallel processing for simultaneously encoding a plurality of pixels without decreasing prediction precision. For example, when all the pixels are divided into a plurality of groups in units of pixels or scanning lines and these groups are to be encoded in parallel, a pixel to be encoded and a pixel used for generating a predicted value are separated from each other on the screen, thus considerably decreasing the prediction precision.
For this reason, the coding device for performing such two-dimensional prediction cannot easily achieve high-speed processing, and is not suitable for processing of a digital video signal having a very high bit rate.